const processData = {
	"dataSet": {
		"外卖订单参数": [{
			"外卖订单号": "",
			"用餐人数": "用户没有选择用餐人数",
			"配送员电话": "",
			"外卖原单金额": null,
			"外卖实付金额": null,
			"外卖下单时间": null,
			"是否已送出": "否",
			"送出时间": null,
			"商户实收金额": 0.0,
			"第三方平台佣金": 0.0,
			"餐盒费": 0.0,
			"商家承担金额": 0.0,
			"第三方平台承担金额": 0.0,
			"第三方系统商品总计": 0.0,
			"外卖门店地址": "",
			"外卖订单门店流水号": "",
			"外部配送费": 0.0,
			"配送类型": "立即配送",
			"订单类型名称": null,
			"商户": null,
			"整单备注": null,
			"预配送时间": null,
			"商品总额": null,
			"收货人": null,
			"顾客号码": null,
			"取餐码": null,
			"收货地址": null
		}],
		"支付表": [],
		"标签表": [{
			"金额": null,
			"单价": null,
			"标签": null,
			"备注": null,
			"sku": null,
			"商品编码": null,
			"商品名称": null,
			"规格名称": null,
			"orderItemId": null,
			"外卖商品名称": null,
			"外卖商品标签名称": null,
			"外卖商品规格标签名称": null,
			"取餐码": null,
			"桌号": null,
			"用餐方式": null,
			"清单价": null,
			"时间": null,
			"标签商品数": null,
			"当前标签商品数": null,
			"门店名称": null,
			"单据来源": null
		}],
		"会员表": [{
			"地址": null,
			"卡金额": null,
			"卡号": null,
			"卡号2": null,
			"等级": null,
			"名称": "",
			"积分": null,
			"手机": "",
			"性别": null
		}],
		"点餐表": [{
			"门店地址": "广东省广州市番禺区广州番禺汉溪长隆地铁G",
			"门店": "睿本化妆品体验店",
			"取餐码(旧)": 1005,
			"取餐码": "W1005",
			"桌号": "2",
			"手机": "",
			"用餐方式": "堂食",
			"点餐地址": "",
			"取餐方式": "",
			"点餐人姓名": "",
			"商户电话": "161615515151"
		}],
		"订单行表": [],
		"门店表": [],
		"配送表": [{
			"地址": null,
			"联系人": null,
			"手机": null
		}],
		"订单主表": [],
	},
	getPrintOrderDetailData(_this, data) {
		var orderJson = data.pushJson || data;
		var payList = data.payList || data.allPayList || [];
		console.log(orderJson, '===orderJson====,订单');
		var companyInfo = JSON.parse(localStorage.getItem("companyInfo"));
		console.log(payList, '======payList===');
		var {
			docTypeInfo,
			upData,
			deliveryTypeInfo,
			items,
			thirdCoupons,
			takeCardNoInfo,
			takeTypeInfo,
			giftProductSet,
			additionalItemProductSet,
			speedOrderDiscountSplits,
			member,
			staff
		} = orderJson;
		var pays = [],
			orderItems = [],
			members = {};
		var channelObj = {
			'zhifubao': '支付宝',
			'kuaishou': '快手券',
			'meituan': '美团券',
			'douyin': '抖音券',
			"koubei": "口碑券",
			"dianping": "美团券"
		}
		var canPrint = 1;
		if(payTypeList) {
			canPrint = 0;
		}
		try {
			pays = thirdCoupons.map(item => {
				return {
					createDate: '',
					guestPayment: item.dealPrice,
					id: item.id,
					payAmount: item.dealPrice,
					payType: item.channel,
					PayTypeName: (item.channel && channelObj[item.channel]) ? channelObj[item.channel] : item.channelName,
					entityCardNo: item.couponCode
				}
			})
		} catch(e) {
			//TODO handle the exception
		}
		let changePrices = 0 //找零
		let cashPayMoney = 0 //找零
		let paidMoney = 0 //找零
		let unPaidMoney = 0 //找零
		var printBalance = -1;
		var serviceAmount = -1;
		var shoppingCardPaymentAmount = 0; //购物卡支付金额
		var physicalCardPaymentAmount = 0; //实体卡支付金额
		pays = payList.map(item => {
			changePrices += parseFloat(item.offlinePayParameter.changePayment)
			if(item.payType == 'CashPay' && item.offlinePayParameter) {
				cashPayMoney = _this.formatretain2(cashPayMoney * 1 + item.offlinePayParameter.guestPayment * 1) * 1
			}
			paidMoney = _this.formatretain2(paidMoney * 1 + item.payAmount * 1) * 1
			if(item.paycode == 'MCardPay') {
				printBalance = item.entityCardBalance;
				shoppingCardPaymentAmount += item.payAmount * 1
			}
			if(item.paycode == 'EntityCard') {
				physicalCardPaymentAmount += item.payAmount * 1
			}
			if(item.paycode == 'SCardPay') {
				serviceAmount = item.entityCardBalance;

			}
			if(payTypeList[item.paycode]) {
				canPrint = 1
			}
			return {
				createDate: item.createDate || '',
				guestPayment: item.guestPayment || '',
				id: item.id || '',
				internalAccounting: item.internalAccounting || '',
				payAmount: item.payAmount || '',
				payType: item.payType || '',
				PayTypeName: item.payTypeName || '',
				postingDate: item.postingDate || '',
				printBalance: item.entityCardBalance || 0,
				printLastBalance: item.entityCardBalance || 0,
				isPrintBalance: (item.paycode == 'EntityCard' || item.paycode == 'MCardPay' || item.paycode == 'SCardPay') ? 1 : 0,
				remark: item.remark || '',
				sourceCode: item.sourceCode || '',
				sourceDesc: item.sourceDesc || '',
				tradeNo: item.tradeNo || '',
				entityCardNo: item.offlinePayParameter.cardNo || ''
			}
		})
		//		if(items&&items[0]){
		//			items=items.reverse()
		//		}
		items.forEach(it => {
			var staffCode = ''
			var staffName = '';
			if(it.staff) {
				staffCode = it.staff.staffCode;
				staffName = it.staff.staffName;
			}

			it.productSet.map(item => {
				console.log(item, 'it.productSet.map');
				orderItems.push({
					promotionTotal: item.actuallyPaid,
					serviceProject: item.serviceProject,
					isServiceMitem: item.serviceProject == 1 ? true : false,
					promotionPrice: item.actuallyUnitPaid,
					totalDealPrice: (item.quantity * item.dealPrice).toFixed(2),
					totalRealPrice: item.actuallyPaid,
					realPrice: item.actuallyUnitPaid,
					dealPrice: item.dealPrice,
					listPrice: item.dealPrice,
					id: item.id,
					itemCode: item.itemCode,
					skuBarcode: item.skuBarcode,
					skuBarCode: item.skuBarcode,
					itemName: item.itemName,
					specName: item.specName,
					specId: item.specId,
					itemId: item.itemId,
					itemQuantity: item.itemQuantity,
					itemUnit: item.itemUnit,
					quantity: item.quantity,
					salePrice: item.salePrice,
					salePriceAmount: item.salePriceAmount,
					actuallyPaid: item.actuallyPaid,
					actuallyUnitPaid: item.actuallyUnitPaid,
					memberPrice: item.memberPrice || '',
					staffName: staffName,
					staffCode: staffCode,
					bmItems: item.bomProductSet || [],
					bomType: item.bomType,
					labels: item.labelGroups ? (() => {
						return item.labelGroups.map(s => {
							var labelName = ''
							s.labelSet.map((set, i) => {
								labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
							})
							return {
								labelData: s.labelSet,
								labelTitle: labelName,
								quantity: s.quantity * 1,
								labelPrice: s.price * 1,
							}
						})
					})() : []

				})
			})
			if(it.additionalItemProductSet) {
				it.additionalItemProductSet.map(item => {
					orderItems.push({
						promotionTotal: item.actuallyUnitPaid,
						totalDealPrice: (item.quantity * item.dealPrice).toFixed(2),
						totalRealPrice: item.actuallyPaid,
						realPrice: item.actuallyUnitPaid,
						dealPrice: item.dealPrice,
						listPrice: item.dealPrice,
						id: item.id,
						itemCode: item.itemCode,
						skuBarcode: item.skuBarcode,
						skuBarCode: item.skuBarcode,
						itemName: item.itemName,
						specName: item.specName,
						specId: item.specId,
						itemQuantity: item.quantity,
						itemUnit: item.itemUnit,
						quantity: item.quantity,
						salePrice: item.salePrice,
						salePriceAmount: item.salePriceAmount,
						actuallyPaid: item.actuallyPaid,
						actuallyUnitPaid: item.actuallyUnitPaid,
						memberPrice: item.memberPrice || '',
						staffName: staffName,
						staffCode: staffCode,
						bmItems: [],
						labels: item.labelGroups ? (() => {
							return item.labelGroups.map(s => {
								var labelName = ''
								s.labelSet.map((set, i) => {
									labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
								})
								return {
									labelData: s.labelSet,
									labelTitle: labelName,
									quantity: s.quantity * 1,
									labelPrice: s.price * 1,
								}
							})
						})() : []

					})
				})
			}
			if(it.giftProductSet) {
				it.giftProductSet.map(item => {
					orderItems.push({
						promotionTotal: 0,
						totalDealPrice: 0,
						totalRealPrice: 0,
						realPrice: 0,
						dealPrice: 0,
						listPrice: 0,
						id: item.id,
						itemCode: item.itemCode,
						skuBarcode: item.skuBarcode,
						skuBarCode: item.skuBarcode,
						itemName: item.itemName,
						specName: item.specName,
						specId: item.specId,
						itemQuantity: item.quantity,
						itemUnit: item.itemUnit,
						quantity: item.quantity,
						salePrice: 0,
						salePriceAmount: 0,
						actuallyPaid: 0,
						actuallyUnitPaid: 0,
						memberPrice: 0,
						staffName: staffName,
						staffCode: staffCode,
						bmItems: [],
						labels: item.labelGroups ? (() => {
							return item.labelGroups.map(s => {
								var labelName = ''
								s.labelSet.map((set, i) => {
									labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
								})
								return {
									labelData: s.labelSet,
									labelTitle: labelName,
									quantity: s.quantity * 1,
									labelPrice: s.price * 1,
								}
							})
						})() : []

					})
				})
			}
		})
		if(additionalItemProductSet) {
			additionalItemProductSet.map(item => {
				orderItems.push({
					promotionTotal: item.actuallyUnitPaid,
					totalDealPrice: (item.quantity * item.dealPrice).toFixed(2),
					totalRealPrice: item.actuallyPaid,
					realPrice: item.actuallyUnitPaid,
					dealPrice: item.dealPrice,
					listPrice: item.dealPrice,
					id: item.id,
					itemCode: item.itemCode,
					skuBarcode: item.skuBarcode,
					skuBarCode: item.skuBarcode,
					itemName: item.itemName,
					specName: item.specName,
					specId: item.specId,
					itemQuantity: item.quantity,
					itemUnit: item.itemUnit,
					quantity: item.quantity,
					salePrice: item.salePrice,
					salePriceAmount: item.salePriceAmount,
					actuallyPaid: item.actuallyPaid,
					actuallyUnitPaid: item.actuallyUnitPaid,
					memberPrice: item.memberPrice || '',
					staffName: staff.staffName,
					staffCode: staff.staffCode,
					bmItems: [],
					labels: item.labelGroups ? (() => {
						return item.labelGroups.map(s => {
							var labelName = ''
							s.labelSet.map((set, i) => {
								labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
							})
							return {
								labelData: s.labelSet,
								labelTitle: labelName,
								quantity: s.quantity * 1,
								labelPrice: s.price * 1,
							}
						})
					})() : []

				})
			})
		}
		if(giftProductSet) {
			giftProductSet.map(item => {
				orderItems.push({
					promotionTotal: 0,
					totalDealPrice: 0,
					totalRealPrice: 0,
					realPrice: 0,
					dealPrice: 0,
					listPrice: 0,
					id: item.id,
					itemCode: item.itemCode,
					skuBarcode: item.skuBarcode,
					skuBarCode: item.skuBarcode,
					itemName: item.itemName,
					specName: item.specName,
					specId: item.specId,
					itemQuantity: item.quantity,
					itemUnit: item.itemUnit,
					quantity: item.quantity,
					salePrice: 0,
					salePriceAmount: 0,
					actuallyPaid: 0,
					actuallyUnitPaid: 0,
					memberPrice: 0,
					staffName: staff.staffName,
					staffCode: staff.staffCode,
					bmItems: [],
					labels: item.labelGroups ? (() => {
						return item.labelGroups.map(s => {
							var labelName = ''
							s.labelSet.map((set, i) => {
								labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
							})
							return {
								labelData: s.labelSet,
								labelTitle: labelName,
								quantity: s.quantity * 1,
								labelPrice: s.price * 1,
							}
						})
					})() : []

				})
			})
		}
		if(member) {
			members = member
		}
		if(printBalance >= 0) {
			members.shoppingAmount = printBalance;
		}
		if(serviceAmount >= 0) {
			members.serviceAmount = serviceAmount;
		}
		members.cardMoney = _this.formatretain2(members.shoppingAmount * 1 + members.serviceAmount * 1)
		var orderTotalDiscountAmount = 0
		var couponAmount = upData.couponAmount || 0
		var totalDiscountAmount = orderJson.totalDiscountAmount || 0
		try {
			orderTotalDiscountAmount = _this.formatretain2(couponAmount * 1 + totalDiscountAmount * 1)
		} catch(e) {}
		return {
			ResultInt: 0,
			delivery: {
				companyPhone: companyInfo.companyPhone,
				address: deliveryTypeInfo.address || '',
				companyName: deliveryTypeInfo.companyName || '',
				deliveryExpressType: deliveryTypeInfo.deliveryExpressType || '',
				deliveryType: deliveryTypeInfo.deliveryType || '',
				deliveryTypeName: deliveryTypeInfo.deliveryTypeName || '',
				takeDate: deliveryTypeInfo.takeDate || '',
				takeDateOriginal: deliveryTypeInfo.takeDateOriginal || '',
				takeTimeQuantums: deliveryTypeInfo.takeTimeQuantums || '',
			},
			// (order.order.productCustomDiscountAmount || 0) * 1 + (order.order.productPromotionAmount || 0) * 1 + (order.order.promotionAmount || 0)

			changePayment: orderJson.changePayment || changePrices,
			order: {
				sourceChannelName: "POS",
				takeTypeAlias: takeTypeInfo.takeType || '',
				orderTotalDiscountAmount: orderTotalDiscountAmount * 1,
				changePayment: orderJson.changePayment || changePrices || 0,
				cashPayMoney: cashPayMoney || 0,
				guestPayment: orderJson.guestPayment || 0,
				couponMoney: upData.couponAmount || 0,
				totalMoney: orderJson.totalAmount || 0,
				unPaidMoney: (orderJson.totalAmount * 1 - paidMoney * 1).toFixed(2) * 1,
				/*未付金额*/
				paidMoney: paidMoney || 0,
				/*实付金额*/
				orderDate: upData.creatDate || '',
				orderNo: orderJson.outOrderNo || '',
				orderId: orderJson.outOrderNo || '',
				outOrderNo: orderJson.outOrderNo || '',
				takeCardNo: takeCardNoInfo.takeCardNo || '',
				installType: orderJson.mealTakeCode + '',
				takeType: takeTypeInfo.takeType || '',
				companyName: upData.companyName || '',
				docTypeName: docTypeInfo.docTypeName || '',
				orderTypeName: upData.orderTypeName || '',
				payStatusName: upData.payStatusName || '',
				cashier: upData.cashier || '',
				creatDate: upData.creatDate || '',
				remark: orderJson.remark || '',
				totalQuantity: upData.totalQuantity || 0,
				realTotal: upData.totalQuantity || 0,
				totalAmount: orderJson.totalAmount || 0,
				totalDiscountAmount: orderJson.totalDiscountAmount || 0,
				couponAmount: upData.couponAmount || 0,
				userCode: upData.userCode || '',
				orderTypeName: docTypeInfo.orderTypeName || '',
				realMoney: orderJson.amountActuallyPaid * 1,
				internalAccounting: 0,
				productCustomDiscountAmount: orderJson.customDiscountAmount || 0,
				productPromotionAmount: orderJson.itemsTotalDiscountAmount || 0,
				promotionAmount: orderJson.orderDiscountAmount,
				maLing: orderJson.roundingAmount || '0' || '抹零金额',
				maling: orderJson.roundingAmount || '0' || '抹零金额',
				companyPhone: companyInfo.companyPhone,
			},
			companyBaseInfo: {
				phone: companyInfo.companyPhone
			},
			mealInfo: {
				mealTakeCode: data.mealTakeCode,
				takeCardNo: takeCardNoInfo.takeCardNo,
				companyAddress: companyInfo.address,
				companyName: upData.companyName,
				installType: orderJson.mealTakeCode + '',
				phone: members.phone,
				takeTypeAlias: takeTypeInfo.takeType,
				mealAddress: '',
				mealWayName: takeTypeInfo.takeType,
				mealConsignee: members.name,
				companyPhone: companyInfo.companyPhone,
			},
			guestPayment: orderJson.amountActuallyPaid,
			changePayment: orderJson.changePayment || changePrices || 0,
			member: members,
			guideInfo: {
				staffName: staff.staffName,
				staffCode: staff.staffCode,
				userName: staff.staffName,
			},
			orderItem: orderItems,
			payment: pays,
			canPrint: canPrint
		}

	},
	getPrintData: function(_this, data) {
		var orderJson = data.pushJson || data;
		var payList = data.payList || data.allPayList || [];
		console.log(payList, '支付列表')
		console.log(orderJson, '打印数据')
		var {
			docTypeInfo,
			upData,
			thirdCoupons,
			deliveryTypeInfo,
			takeCardNoInfo,
			takeTypeInfo,
			items,
			giftProductSet,
			additionalItemProductSet,
			speedOrderDiscountSplits,
			member,
			address,
			staff
		} = orderJson;
		var canPrint = 1;
		var pays = [];
		if(payTypeList) {
			canPrint = 0;
		}
		var channelObj = {
			'zhifubao': '支付宝',
			'kuaishou': '快手券',
			'meituan': '美团券',
			'douyin': '抖音券',
			"koubei": "口碑券",
			"dianping": "美团券"
		}
		var thirddealPrice = 0;
		if(thirdCoupons && thirdCoupons[0]) {
			thirdCoupons.map(item => {
				thirddealPrice = _this.formatretain2(thirddealPrice * 1 + item.dealPrice * 1) * 1;
				for(var i = 0; i < item.count; i++) {
					pays.push({
						"方式": (item.channel && channelObj[item.channel]) ? channelObj[item.channel] : item.channelName,
						"金额": _this.formatretain2(item.dealPrice / item.count),
						"时间": '',
						"币种符号": "",
						"实体卡号": item.couponCode,
						"内部核算金额": 0,
						"卡余额": 0,
						"支付券名": item.dealTitle,
						"平台券号": item.couponCode,
						"是否开启支付优惠": '',
						"商家实收金额": _this.formatretain2(item.dealPrice / item.count),
						"金额(含优惠)": _this.formatretain2((item.discountAmount + item.dealPrice) / item.count),
						"优惠金额": _this.formatretain2(item.discountAmount / item.count),
						"消费前卡余额": 0.0,
						"客付款": item.dealPrice
					});
				}
			});
		}
		var __common_login = {
			DataLine: {}
		}
		var companyInfo = {}
		try {
			var __common_login = localStorage.getItem("common_login");
			var companyInfo = localStorage.getItem("companyInfo");
			__common_login = JSON.parse(__common_login);
			companyInfo = JSON.parse(companyInfo);
			this.dataSet["点餐表"] = [{
				"门店地址": companyInfo.address || '',
				"门店": __common_login.DataLine.companyName || "",
				"桌号": takeCardNoInfo.takeCardNo || '',
				"手机": "",
				"取餐码": orderJson.mealTakeCode || '',
				"用餐方式": takeTypeInfo.takeType,
				"商户电话": ""
			}];
		} catch(e) {
			console.log(e)
		}
		var printBalance = -1
		var serviceAmount = -1;
		var paidMoney = 0;
		var cardPaidMoney = 0;
		var peelingWeight = 0;
		var peelingMoney = 0;
		let isPeelingWeightResp = 0;
		var shoppingCardPaymentAmount = 0;
		var physicalCardPaymentAmount = 0;
		var gifPaidMoney = 0;
		var itemGifPaidMoney = 0;
		var giftAmount = 0;
		var addBuyAmout = 0
		var addBuyAmout2 = 0
		payList.map(item => {
			console.log(item, '支付')
			if(item.offlinePayParameter && item.offlinePayParameter.changePayment) {
				paidMoney = _this.formatretain2(paidMoney * 1 + item.offlinePayParameter.changePayment * 1) * 1
			}
			let payTypeName = item.payTypeName;
			if(item.offlinePayParameter && item.offlinePayParameter.specialFastThPay && item.offlinePayParameter.specialFastThPay.thPayInfo) {
				let thPayInfo = item.offlinePayParameter.specialFastThPay.thPayInfo;
				if(thPayInfo.payTypeName) {
					payTypeName = thPayInfo.payTypeName;
				}
			}
			if(item.paycode == 'MCardPay' || item.payType == 'SCardPay') {
				cardPaidMoney = _this.formatretain2(cardPaidMoney * 1 + item.payAmount * 1) * 1
			}
			if(item.cardPayResult && item.cardPayResult.giftAmount) {
				giftAmount = _this.formatretain2(giftAmount * 1 + item.cardPayResult.giftAmount * 1) * 1
			}
			pays.push({
				"方式": payTypeName || "",
				"金额": item.payAmount || "",
				"时间": item.creatDate || "",
				"币种符号": "",
				"实体卡号": item.offlinePayParameter ? item.offlinePayParameter.cardNo : '',
				"内部核算金额": 0,
				"卡余额": item.entityCardBalance || 0,
				"支付券名": "",
				"平台券号": "",
				"是否开启支付优惠": '',
				"商家实收金额": item.payAmount || "",
				"金额(含优惠)": item.payAmount || "",
				"优惠金额": '',
				"实体卡_卡面编号": item.offlinePayParameter ? item.offlinePayParameter.outerCode : '',
				"实体卡_卡面编号（脱敏）": (item.offlinePayParameter && item.offlinePayParameter.outerCode) ? (item.offlinePayParameter.outerCode.substring(0, 1) + "***" + item.offlinePayParameter.outerCode.substring(item.offlinePayParameter.outerCode.length - 1, item.offlinePayParameter.outerCode.length)) : "",
				"消费前卡余额": item.entityCardBalance ? ((item.entityCardBalance * 1 + item.payAmount * 1).toFixed(2)) : 0,
				"消费后卡余额": item.entityCardBalance || 0,
				"消费后的实体卡余额": item.paycode == 'EntityCard' ? (item.entityCardBalance || 0) : '',
				"消费后的购物卡余额": item.paycode == 'MCardPay' ? (item.entityCardBalance || 0):'',
				"客付款": item.offlinePayParameter ? item.offlinePayParameter.guestPayment : item.payAmount
			})
			if(payTypeList[item.paycode]) {
				canPrint = 1
			}
			if(item.paycode == 'MCardPay') {
				printBalance = item.entityCardBalance;
				shoppingCardPaymentAmount += item.payAmount * 1
			}
			if(item.paycode == 'SCardPay') {
				serviceAmount = item.entityCardBalance;
			}
			if(item.paycode == 'EntityCard') {
				physicalCardPaymentAmount += item.payAmount * 1
			}
		})
		this.dataSet["支付表"] = pays;
		if(member) {
			if(printBalance >= 0) {
				member.shoppingAmount = printBalance;
			}
			if(serviceAmount >= 0) {
				member.serviceAmount = serviceAmount;
			}
			member.cardMoney = _this.formatretain2(member.shoppingAmount * 1 + member.serviceAmount * 1)
			this.dataSet["会员表"] = [{
				"地址": member.provinceName + member.cityName + member.regionName + member.address + member.houseNumber,
				"卡金额": _this.formatretain2(member.cardMoney * 1),
				"卡号": member.cardNo,
				"卡号2": member.cardNo ? ('****' + member.cardNo.substring(member.cardNo.length - 4, member.cardNo.length)) : '',
				"等级": member.gradeName,
				"名称": member.userName,
				"积分": member.integral,
				"手机": member.phone,
				"手机(脱敏)": member.phone ? (member.phone.substring(0, 3) + "****" + member.phone.substring(member.phone.length - 4, member.phone.length)) : '',
				"性别": member.sex
			}]
			this.dataSet["配送表"] = [{
				"地址": member.provinceName + member.cityName + member.regionName + member.address + member.houseNumber,
				"联系人": member.name,
				"手机": member.sendPhone,
			}];

		} else {
			this.dataSet["会员表"] = [{
				"地址": null,
				"卡金额": null,
				"卡号": null,
				"卡号2": null,
				"等级": null,
				"名称": "",
				"积分": null,
				"手机": "",
				"性别": null
			}]
			this.dataSet["配送表"] = [{
				"地址": address.provinceName + address.cityName + address.regionName + address.address + address.houseNumber,
				"联系人": address.name,
				"手机": address.sendPhone,
			}];
		}
		var orderItems = [];
		var lables = [];
		var qty = 0
		items.map(it => {
			if(it.suitType) {
				if(it.peelingWeightResp) {
					peelingWeight = _this.formatretain3(peelingWeight * 1 + (it.peelingWeightResp.weighingNumber || 0) * 1);
					peelingMoney = _this.formatretain3(peelingMoney * 1 + (it.peelingWeightResp.weighingNumber || 0) * it.actuallyUnitPaid * 1);
					if(it.peelingWeightResp.weighingNumber) {
						isPeelingWeightResp = 1;
					}
				}
				let itemPromotion = it.itemPromotion || {};
				orderItems.push({
					"orderItemId": itemPromotion.id || it.virtualItemSpecId,
					"商品编码": it.itemCode,
					"SKU码": it.skuBarcode,
					"商品名称": it.virtualItemName,
					"规格名称": '',
					"商品规格": it.virtualItemName,
					"规格id": it.id,
					"数量": it.quantity,
					"数量(显示皮重)": it.quantity + "(去皮" + (it.peelingWeightResp && it.peelingWeightResp.weighingNumber ? it.peelingWeightResp.weighingNumber : "0") + ")",
					"数量 (显示是否去皮)": it.quantity + ((it.peelingWeightResp && it.peelingWeightResp.weighingNumber) ? "（已去皮）" : ""),
					"数量(不显示套餐虚拟商品数量)": '',
					"单位": it.itemUnit || it.unit,
					"总数": it.quantity + '' + (it.itemUnit || it.unit),
					"零售价": it.dealPrice,
					"行小计": it.actuallyPaid,
					"不包含整单优惠的小计": _this.formatretain3(it.dealPriceAmount) * 1 / 1,
					"优惠金额": it.couponAmount,
					"行备注": "",
					"清单价": it.dealPrice,
					"成交价": it.actuallyPaid,
					"会员价": it.dealPrice || "",
					"实付单价": _this.formatretain3(it.actuallyPaid / it.quantity),
					"实付单价（不包含整单优惠）": '',
					"服务导购": it.staff.staffName,
					"服务导购工号": it.staff.staffCode,
					"溯源码": "",
					"标签": this.getLabelNameFn(it),
					"标签带金额": this.getLabelNameFn2(it),
					"外卖商品名称": "",
					"外卖商品标签名称": "",
					"外卖商品规格标签名称": null,
					"折扣率": '',
					"商品标签": "",
					"商品规格标签": this.getLabelNameFn(it),
					"商品标签带金额": this.getLabelNameFn2(it),
					"会员商城别名": "",
					"主商品id": it.mainSpecId,
					"口袋号": null,
					"实付单价（子商品不显示）": _this.formatretain3(it.actuallyUnitPaid),
					"零售价（子商品不显示）": _this.formatretain3(it.dealPrice),
					"零售价（不含优惠和子商品不显示）": _this.formatretain3(it.dealPrice),
					"行小计（子商品不显示）": _this.formatretain2(it.actuallyPaid),
					"行小计（不含优惠和子商品不显示）": _this.formatretain2(it.dealPriceAmount)
				})
			}
			if(it.shopCartItemType == 9) {
				orderItems.push({
					"orderItemId": it.virtualItemSpecId,
					"商品编码": it.itemCode,
					"SKU码": it.skuBarcode,
					"商品名称": it.virtualItemName,
					"规格名称": '',
					"商品规格": it.virtualItemName,
					"规格id": it.id,
					"数量": it.quantity,
					"数量(显示皮重)": it.quantity + "(去皮" + 0 + ")",
					"数量 (显示是否去皮)": it.quantity,
					"数量(不显示套餐虚拟商品数量)": it.quantity,
					"单位": it.itemUnit || it.unit,
					"总数": it.quantity + '' + (it.itemUnit || it.unit),
					"零售价": it.dealPrice,
					"行小计": it.actuallyPaid,
					"不包含整单优惠的小计": _this.formatretain3(it.dealPriceAmount) * 1 / 1,
					"优惠金额": it.couponAmount,
					"行备注": "",
					"祝福语":it.greeting,
					"清单价": it.dealPrice,
					"成交价": it.actuallyPaid,
					"会员价": it.dealPrice || "",
					"实付单价": _this.formatretain3(it.actuallyPaid / it.quantity),
					"实付单价（不包含整单优惠）": '',
					"服务导购": it.staff.staffName,
					"服务导购工号": it.staff.staffCode,
					"溯源码": "",
					"标签": '',
					"标签带金额": '',
					"外卖商品名称": "",
					"外卖商品标签名称": "",
					"外卖商品规格标签名称": null,
					"折扣率": '',
					"商品标签": "",
					"商品规格标签": '',
					"商品标签带金额": '',
					"会员商城别名": "",
					"主商品id": it.virtualItemSpecId,
					"口袋号": null,
					"实付单价（子商品不显示）": _this.formatretain3(it.packageUnitPrice),
					"零售价（子商品不显示）": _this.formatretain3(it.dealPrice),
					"零售价（不含优惠和子商品不显示）": _this.formatretain3(it.dealPrice),
					"行小计（子商品不显示）": _this.formatretain2(it.actuallyPaid),
					"行小计（不含优惠和子商品不显示）": _this.formatretain2(it.dealPriceAmount)
				})
			}
			console.log(it, '打印items')
			it.productSet.map(item => {
				var orderPrice = 0;
				if(speedOrderDiscountSplits && speedOrderDiscountSplits[0]) {
					speedOrderDiscountSplits.map(Split => {
						if(item.id == Split.id) {
							if(!(Split.splitType == 6 || Split.splitType == 3)) {
								orderPrice = _this.formatretain2(orderPrice * 1 + Split.splitPriceAmount * 1)
							}
						}
					})
				}
				console.log(item, '3333333333333')
				if(item.peelingWeightResp) {
					peelingWeight = _this.formatretain3(peelingWeight * 1 + (item.peelingWeightResp.weighingNumber || 0) * 1);
					peelingMoney = _this.formatretain3(peelingMoney * 1 + (item.peelingWeightResp.weighingNumber || 0) * item.actuallyUnitPaid * 1);
					if(item.peelingWeightResp.weighingNumber) {
						isPeelingWeightResp = 1;
					}
				}
				if(item.shopCartItemType == 'GIft') {
					//【【C794美味思】【收银端】门店下单后，同样的商品，打印出来的优惠金额字段显示的效果不一样。】https://www.tapd.cn/49734906/bugtrace/bugs/view/1149734906001046321
					gifPaidMoney = _this.formatretain2(gifPaidMoney * 1 + _this.formatretain2(item.quantity * item.dealPrice)*1)*1
				}
				orderItems.push({
					"orderItemId": item.id,
					"商品编码": item.itemCode,
					"SKU码": item.skuBarcode,
					"商品名称": (it.suitType || it.shopCartItemType == 9) ? ("--" + item.itemName) : item.itemName,
					"规格名称": item.specName,
					"商品规格": ((it.suitType || it.shopCartItemType == 9) ? "--" : '') + item.itemName + '[' + item.specName + ']',
					"规格id": item.specId,
					"数量": item.itemQuantity,
					"数量(显示皮重)": item.itemQuantity + "(去皮" + (item.peelingWeightResp && item.peelingWeightResp.weighingNumber ? item.peelingWeightResp.weighingNumber : "0") + ")",
					"数量 (显示是否去皮)": item.quantity + ((item.peelingWeightResp && item.peelingWeightResp.weighingNumber) ? "（已去皮）" : ""),
					"数量(不显示套餐虚拟商品数量)": item.itemQuantity,
					"单位": item.itemUnit,
					"总数": item.quantity + '' + (item.itemUnit || item.unit),
					"零售价": item.dealPrice,
					"行小计": item.actuallyPaid,
					"不包含整单优惠的小计": _this.formatretain2(item.actuallyPaid * 1 + orderPrice * 1) * 1 / 1,
					"优惠金额": _this.formatretain2(item.salePriceAmount * 1 - item.actuallyPaid * 1 - (orderPrice * 1 || 0)),
					"行备注": "",
					"清单价": item.dealUnitPrice,
					"成交价": item.actuallyUnitPaid,
					"会员价": item.memberPrice || "",
					"实付单价": item.actuallyUnitPaid,
					"实付单价（不包含整单优惠）": _this.formatretain3(_this.formatretain2(item.actuallyPaid * 1 + orderPrice * 1) / item.itemQuantity),
					"服务导购": it.staff.staffName,
					"服务导购工号": it.staff.staffCode,
					"溯源码": "",
					"祝福语":item.greeting,
					"标签": this.getLabelNameFn(item),
					"标签带金额": this.getLabelNameFn2(item),
					"外卖商品名称": "",
					"外卖商品标签名称": "",
					"外卖商品规格标签名称": null,
					"折扣率": _this.formatretain2(item.discountPrice / item.salePrice) * 100 + '%',
					"商品标签": "",
					"商品规格标签": ((it.suitType || it.shopCartItemType == 9) ? "--" : '') + item.itemName + '[' + item.specName + ']' + this.getLabelNameFn(item),
					"商品标签带金额": ((it.suitType || it.shopCartItemType == 9) ? "--" : '') + item.itemName + this.getLabelNameFn2(item),
					"会员商城别名": "",
					"主商品id": it.mainSpecId,
					"行小计(显示赠品小计)": item.shopCartItemType == 'GIft' ? _this.formatretain2(item.dealPrice * item.quantity) : _this.formatretain2(item.actuallyPaid * 1),
					"口袋号": null,
					"实付单价（子商品不显示）": (it.suitType || it.shopCartItemType == 2 || it.shopCartItemType == 9) ? '' : item.actuallyUnitPaid,
					"零售价（子商品不显示）": (it.suitType || it.shopCartItemType == 2 || it.shopCartItemType == 9) ? '' : item.dealPrice,
					"零售价（不含优惠和子商品不显示）": (it.suitType || it.shopCartItemType == 2 || it.shopCartItemType == 9) ? '' : item.dealPrice,
					"行小计（子商品不显示）": (it.suitType || it.shopCartItemType == 2 || it.shopCartItemType == 9) ? '' : _this.formatretain2(item.actuallyPaid * 1),
					"行小计（不含优惠和子商品不显示）": (it.suitType || it.shopCartItemType == 2 || it.shopCartItemType == 9) ? '' : _this.formatretain2(item.salePriceAmount)
				});
				this.labelsFn(item, lables, orderJson);
				if(item.bomProductSet && item.bomProductSet[0]) {
					item.bomProductSet.map(bom => {
						if(bom.peelingWeightResp) {
							peelingWeight = _this.formatretain3(peelingWeight * 1 + (bom.peelingWeightResp.weighingNumber || 0) * 1);
							peelingMoney = _this.formatretain3(peelingMoney * 1 + (bom.peelingWeightResp.weighingNumber || 0) * bom.actuallyUnitPaid * 1);
							if(bom.peelingWeightResp.weighingNumber) {
								isPeelingWeightResp = 1;
							}
						}
						orderItems.push({
							"orderItemId": bom.id,
							"商品编码": bom.itemCode,
							"SKU码": bom.skuBarcode,
							"商品名称": '--' + bom.itemName,
							"规格名称": bom.specName,
							"规格id": bom.specId,
							"数量": bom.quantity,
							"数量(显示皮重)": bom.quantity + "(去皮" + (bom.peelingWeightResp && bom.peelingWeightResp.weighingNumber ? bom.peelingWeightResp.weighingNumber : "0") + ")",
							"数量 (显示是否去皮)": item.quantity + ((item.peelingWeightResp && item.peelingWeightResp.weighingNumber) ? "（已去皮）" : ""),
							"数量(不显示套餐虚拟商品数量)": bom.quantity,
							"单位": bom.itemUnit,
							"总数": bom.quantity + item.itemUnit,
							"零售价": bom.dealPrice,
							"行小计": bom.actuallyPaid,
							"不包含整单优惠的小计": bom.actuallyPaid,
							"优惠金额": '',
							"行备注": "",
							"清单价": bom.dealUnitPrice,
							"成交价": bom.actuallyUnitPaid,
							"会员价": bom.memberPrice || '',
							"实付单价": bom.actuallyUnitPaid,
							"实付单价（不包含整单优惠）": bom.actuallyUnitPaid,
							"服务导购": it.staff.staffName,
							"服务导购工号": it.staff.staffCode,
							"溯源码": "",
							"标签": this.getLabelNameFn(bom),
							"标签带金额": this.getLabelNameFn2(bom),
							"外卖商品名称": "",
							"外卖商品标签名称": "",
							"外卖商品规格标签名称": null,
							"折扣率": _this.formatretain2(bom.discountPrice / item.salePrice) * 100 + '%',
							"商品标签": "",
							"商品规格标签": bom.itemName + '[' + bom.specName + ']' + this.getLabelNameFn(bom),
							"商品标签带金额": bom.itemName + this.getLabelNameFn2(bom),
							"商品规格": bom.itemName + '[' + bom.specName + ']',
							"会员商城别名": "",
							"主商品id": it.mainSpecId,
							"口袋号": null,
							"实付单价（子商品不显示）": null,
							/*bom*/
							"零售价（子商品不显示）": null,
							"零售价（不含优惠和子商品不显示）": null,
							"行小计（子商品不显示）": null,
							"行小计（不含优惠和子商品不显示）": null
						})
						this.labelsFn(bom, lables);
					})
				}
			})
			/*赠品*/
			if(it.giftProductSet && it.giftProductSet[0]) {
				it.giftProductSet.map(item => {
					qty = (qty * 1 + item.quantity * 1).toFixed(4)
					if(item.peelingWeightResp) {
						peelingWeight = _this.formatretain3(peelingWeight * 1 + (item.peelingWeightResp.weighingNumber || 0) * 1);
						peelingMoney = _this.formatretain3(peelingMoney * 1 + (item.peelingWeightResp.weighingNumber || 0) * item.actuallyUnitPaid * 1);
						if(item.peelingWeightResp.weighingNumber) {
							isPeelingWeightResp = 1;
						}
					}
					gifPaidMoney = _this.formatretain2(gifPaidMoney * 1 + item.quantity * item.salePrice)
					orderItems.push({
						"orderItemId": item.id,
						"商品编码": item.itemCode,
						"SKU码": item.skuBarcode,
						"商品名称": item.itemName,
						"规格名称": item.specName,
						"商品规格": item.itemName + '[' + item.specName + ']',
						"规格id": item.specId,
						"数量": item.quantity,
						"数量(显示皮重)": item.quantity + "(去皮" + (item.peelingWeightResp && item.peelingWeightResp.weighingNumber ? item.peelingWeightResp.weighingNumber : "0") + ")",
						"数量 (显示是否去皮)": item.quantity + ((item.peelingWeightResp && item.peelingWeightResp.weighingNumber) ? "（已去皮）" : ""),
						"数量(不显示套餐虚拟商品数量)": item.quantity,
						"单位": item.itemUnit,
						"总数": item.quantity + item.itemUnit,
						"零售价": item.salePrice,
						"行小计": 0,
						"不包含整单优惠的小计": item.quantity * item.salePrice,
						"优惠金额": 0,
						"行备注": "",
						"清单价": item.salePrice,
						"成交价": 0,
						"会员价": 0,
						"实付单价": 0,
						"实付单价（不包含整单优惠）": 0,
						"服务导购": it.staff.staffName,
						"服务导购工号": it.staff.staffCode,
						"溯源码": "",
						"标签": this.getLabelNameFn(item),
						"标签带金额": this.getLabelNameFn2(item),
						"外卖商品名称": "",
						"外卖商品标签名称": "",
						"外卖商品规格标签名称": null,
						"折扣率": _this.formatretain2(item.discountPrice / item.salePrice) * 100 + '%',
						"商品标签": "",
						"商品规格标签": item.itemName + '[' + item.specName + ']' + this.getLabelNameFn(item),
						"商品标签带金额": item.itemName + this.getLabelNameFn2(item),
						"会员商城别名": "",
						"主商品id": it.mainSpecId,
						"口袋号": null,
						"实付单价（子商品不显示）": 0,
						"零售价（子商品不显示）": item.salePrice,
						"行小计(显示赠品小计)": gifPaidMoney,
						"零售价（不含优惠和子商品不显示）": item.salePrice,
						"行小计（子商品不显示）": 0,
						"行小计（不含优惠和子商品不显示）": 0
					})
					this.labelsFn(item, lables, orderJson);
				})
			}
			/*加价购*/
			if(it.additionalItemProductSet && it.additionalItemProductSet[0]) {
				it.additionalItemProductSet.map(item => {
					qty = (qty * 1 + item.quantity * 1).toFixed(4)
					if(item.peelingWeightResp) {
						peelingWeight = _this.formatretain3(peelingWeight * 1 + (item.peelingWeightResp.weighingNumber || 0) * 1);
						peelingMoney = _this.formatretain3(peelingMoney * 1 + (item.peelingWeightResp.weighingNumber || 0) * item.actuallyUnitPaid * 1);
						if(item.peelingWeightResp.weighingNumber) {
							isPeelingWeightResp = 1;
						}
					}
					let itemSaleprice = _this.formatretain2(item.salePrice * item.quantity + item.labelPrice * item.quantity) * 1;
					addBuyAmout = addBuyAmout * 1 + itemSaleprice * 1;
					addBuyAmout2 = addBuyAmout2 * 1 + _this.formatretain2(itemSaleprice - item.actuallyPaid) * 1;

					orderItems.push({
						"orderItemId": item.id,
						"商品编码": item.itemCode,
						"SKU码": item.skuBarcode,
						"商品名称": item.itemName,
						"规格名称": item.specName,
						"商品规格": item.itemName + '[' + item.specName + ']',
						"规格id": item.specId,
						"数量": item.quantity,
						"数量(显示皮重)": item.quantity + "(去皮" + (item.peelingWeightResp && item.peelingWeightResp.weighingNumber ? item.peelingWeightResp.weighingNumber : "0") + ")",
						"数量 (显示是否去皮)": item.quantity + ((item.peelingWeightResp && item.peelingWeightResp.weighingNumber) ? "（已去皮）" : ""),
						"数量(不显示套餐虚拟商品数量)": item.quantity,
						"单位": item.itemUnit,
						"总数": item.quantity + item.itemUnit,
						"零售价": item.salePrice,
						"行小计": item.actuallyPaid,
						"不包含整单优惠的小计": item.actuallyPaid / 1,
						"优惠金额": _this.formatretain2(item.salePriceAmount - item.actuallyPaid),
						"行备注": "",
						"清单价": item.dealUnitPrice,
						"成交价": item.actuallyUnitPaid,
						"会员价": item.memberPrice || '',
						"实付单价": item.actuallyUnitPaid,
						"实付单价（不包含整单优惠）": item.actuallyUnitPaid,
						"服务导购": it.staff.staffName,
						"服务导购工号": it.staff.staffCode,
						"溯源码": "",
						"标签": this.getLabelNameFn(item),
						"标签带金额": this.getLabelNameFn2(item),
						"外卖商品名称": "",
						"外卖商品标签名称": "",
						"外卖商品规格标签名称": null,
						"折扣率": _this.formatretain2(item.discountPrice / item.salePrice) * 100 + '%',
						"商品标签": "",
						"商品规格标签": item.itemName + '[' + item.specName + ']' + this.getLabelNameFn(item),
						"商品标签带金额": item.itemName + this.getLabelNameFn2(item),
						"会员商城别名": "",
						"口袋号": null,
						"实付单价（子商品不显示）": item.actuallyUnitPaid,
						"零售价（子商品不显示）": item.salePrice,
						"零售价（不含优惠和子商品不显示）": item.salePrice,
						"行小计（子商品不显示）": item.actuallyPaid,
						"行小计（不含优惠和子商品不显示）": itemSaleprice
					})
					this.labelsFn(item, lables, orderJson);
				})
			}
		})
		/*订单赠品*/
		if(giftProductSet && giftProductSet[0]) {
			giftProductSet.map(item => {
				qty = (qty * 1 + item.quantity * 1).toFixed(4)
				if(item.peelingWeightResp) {
					peelingWeight = _this.formatretain3(peelingWeight * 1 + (item.peelingWeightResp.weighingNumber || 0) * 1);
					peelingMoney = _this.formatretain3(peelingMoney * 1 + (item.peelingWeightResp.weighingNumber || 0) * item.actuallyUnitPaid * 1);
					if(item.peelingWeightResp.weighingNumber) {
						isPeelingWeightResp = 1;
					}
				}
				gifPaidMoney = _this.formatretain2(gifPaidMoney * 1 + item.quantity * item.salePrice)

				orderItems.push({
					"orderItemId": item.id,
					"商品编码": item.itemCode,
					"SKU码": item.skuBarcode,
					"商品名称": item.itemName,
					"规格名称": item.specName,
					"商品规格": item.itemName + '[' + item.specName + ']',
					"规格id": item.specId,
					"数量": item.quantity,
					"数量(显示皮重)": item.quantity + "(去皮" + (item.peelingWeightResp && item.peelingWeightResp.weighingNumber ? item.peelingWeightResp.weighingNumber : "0") + ")",
					"数量 (显示是否去皮)": item.quantity + ((item.peelingWeightResp && item.peelingWeightResp.weighingNumber) ? "（已去皮）" : ""),
					"数量(不显示套餐虚拟商品数量)": item.quantity,
					"单位": item.itemUnit,
					"总数": item.quantity + item.itemUnit,
					"零售价": item.salePrice,
					"行小计": 0,
					"不包含整单优惠的小计": item.quantity * item.salePrice,
					"优惠金额": 0,
					"行备注": "",
					"清单价": item.salePrice,
					"成交价": 0,
					"会员价": 0,
					"实付单价": 0,
					"实付单价（不包含整单优惠）": 0,
					"服务导购": staff.staffName,
					"服务导购工号": staff.staffCode,
					"溯源码": "",
					"标签": this.getLabelNameFn(item),
					"标签带金额": this.getLabelNameFn2(item),
					"外卖商品名称": "",
					"外卖商品标签名称": "",
					"外卖商品规格标签名称": null,
					"折扣率": '',
					"商品标签": "",
					"商品规格标签": item.itemName + '[' + item.specName + ']' + this.getLabelNameFn(item),
					"商品标签带金额": item.itemName + this.getLabelNameFn2(item),
					"会员商城别名": "",
					"口袋号": null,
					"实付单价（子商品不显示）": 0,
					/*gift*/
					"零售价（子商品不显示）": 0,
					"零售价（不含优惠和子商品不显示）": item.salePrice,
					"行小计（子商品不显示）": 0,
					"行小计(显示赠品小计)": gifPaidMoney,
					"行小计（不含优惠和子商品不显示）": 0
				})
				this.labelsFn(item, lables, orderJson);
			})
		}
		if(additionalItemProductSet && additionalItemProductSet[0]) {
			additionalItemProductSet.map(item => {
				qty = (qty * 1 + item.quantity * 1).toFixed(4)
				if(item.peelingWeightResp) {
					peelingWeight = _this.formatretain3(peelingWeight * 1 + (item.peelingWeightResp.weighingNumber || 0) * 1);
					peelingMoney = _this.formatretain3(peelingMoney * 1 + (item.peelingWeightResp.weighingNumber || 0) * item.actuallyUnitPaid * 1);
					if(item.peelingWeightResp.weighingNumber) {
						isPeelingWeightResp = 1;
					}
				}
				let itemSaleprice = _this.formatretain2(item.salePrice * item.quantity + item.labelPrice * item.quantity) * 1;
				addBuyAmout = addBuyAmout * 1 + itemSaleprice * 1;
				addBuyAmout2 = addBuyAmout2 * 1 + _this.formatretain2(itemSaleprice - item.actuallyPaid) * 1;
				orderItems.push({
					"orderItemId": item.id,
					"商品编码": item.itemCode,
					"SKU码": item.skuBarcode,
					"商品名称": item.itemName,
					"规格名称": item.specName,
					"商品规格": item.itemName + '[' + item.specName + ']',
					"规格id": item.specId,
					"数量": item.quantity,
					"数量(显示皮重)": item.quantity + "(去皮" + (item.peelingWeightResp && item.peelingWeightResp.weighingNumber ? item.peelingWeightResp.weighingNumber : "0") + ")",
					"数量 (显示是否去皮)": item.quantity + ((item.peelingWeightResp && item.peelingWeightResp.weighingNumber) ? "（已去皮）" : ""),
					"数量(不显示套餐虚拟商品数量)": item.quantity,
					"单位": item.itemUnit,
					"总数": item.quantity + item.itemUnit,
					"零售价": item.salePrice,
					"行小计": item.actuallyPaid,
					"不包含整单优惠的小计": item.actuallyPaid / 1,
					"优惠金额": _this.formatretain2(item.salePriceAmount - item.actuallyPaid),
					"行备注": "",
					"清单价": item.dealUnitPrice,
					"成交价": item.actuallyUnitPaid,
					"会员价": item.memberPrice || '',
					"实付单价": item.actuallyUnitPaid,
					"实付单价（不包含整单优惠）": item.actuallyUnitPaid,
					"服务导购": staff.staffName,
					"服务导购工号": staff.staffCode,
					"溯源码": "",
					"标签": this.getLabelNameFn(item),
					"标签带金额": this.getLabelNameFn2(item),
					"外卖商品名称": "",
					"外卖商品标签名称": "",
					"外卖商品规格标签名称": null,
					"折扣率": _this.formatretain2(item.discountPrice / item.salePrice) * 100 + '%',
					"商品标签": "",
					"商品规格标签": item.itemName + '[' + item.specName + ']' + this.getLabelNameFn(item),
					"商品标签带金额": item.itemName + this.getLabelNameFn2(item),
					"会员商城别名": "",
					"祝福语":item.greeting,
					"口袋号": null,
					"实付单价（子商品不显示）": item.actuallyUnitPaid,
					"零售价（子商品不显示）": item.salePrice,
					"零售价（不含优惠和子商品不显示）": item.salePrice,
					"行小计（子商品不显示）": item.actuallyPaid,
					"行小计（不含优惠和子商品不显示）": itemSaleprice
				})
				this.labelsFn(item, lables, orderJson);
			})
		}
		var orderTotalDiscountAmount = 0
		var couponAmount = upData.couponAmount || 0
		var totalDiscountAmount = orderJson.totalDiscountAmount || 0
		try {
			orderTotalDiscountAmount = _this.formatretain2(couponAmount * 1 + totalDiscountAmount * 1 + orderJson.roundingAmount * 1)
		} catch(e) {}
		this.dataSet["订单行表"] = orderItems;
		this.dataSet["标签表"] = lables;
		this.dataSet["门店表"] = [{
			"门店别名": upData.companyName
		}];
		/*【ID1034849】
		【收银端】【极速版2.0】【h5】支持取餐码和商品标签--差异（待定，重新讨论方案）*/
		this.dataSet["订单主表"] = [{
			"id": "",
			"单据编号": orderJson.outOrderNo,
			"商户": upData.companyName,
			"单据类型": docTypeInfo.docTypeName,
			"单据状态": upData.orderTypeName,
			"收银状态": upData.payStatusName,
			"创建人": upData.cashier,
			"创建时间": upData.creatDate,
			"整单备注": orderJson.remark,
			"总数": (upData.totalQuantity * 1 + qty * 1).toFixed(4),
			"去皮总重量": _this.formatretain3(peelingWeight),
			"实收金额": _this.formatretain2(orderJson.amountActuallyPaid * 1 + thirddealPrice * 1),
			"总去皮金额": _this.formatretain2(peelingMoney),
			"商品总额": _this.formatretain2(orderJson.totalAmount * 1 + addBuyAmout * 1),
			"内部核算金额": null,
			"本单积分": orderJson.intrinsicSingleIntegral || null,
			"优惠总额": _this.formatretain2(orderJson.totalDiscountAmount * 1 - itemGifPaidMoney * 1 + orderJson.roundingAmount * 1 + addBuyAmout2 * 1),
			"订单优惠总金额": _this.formatretain2(orderTotalDiscountAmount * 1 - itemGifPaidMoney * 1 + addBuyAmout2 * 1),
			"优惠券金额": upData.couponAmount || 0,
			"配送费": orderJson.expressFee || 0,
			"溯源码": "",
			"显示是否去皮": isPeelingWeightResp ? "已去皮" : "",
			"收银员": upData.cashier,
			"收银员工号": upData.userCode,
			"打印时间": upData.creatDate,
			"配送方式": deliveryTypeInfo.deliveryTypeName ? deliveryTypeInfo.deliveryTypeName : "到店自提",
			"预配送时间": (deliveryTypeInfo.takeTimeQuantums || deliveryTypeInfo.takeDate) ? (deliveryTypeInfo.takeDate + " " + deliveryTypeInfo.takeTimeQuantums) : '',
			"提货人": (deliveryTypeInfo.pickupName || deliveryTypeInfo.pickupPhone) ? (deliveryTypeInfo.pickupName + "（" + deliveryTypeInfo.pickupPhone + '）') : '',
			"订单来源": docTypeInfo.orderTypeName,
			"预计配送时间": deliveryTypeInfo && deliveryTypeInfo.takeDate ? (deliveryTypeInfo.takeDate + ' ' + deliveryTypeInfo.takeTimeQuantums) : '',
			"取餐号": orderJson.mealTakeCode || '',
			"取餐码": orderJson.mealTakeCode || '',
			"商户地址": companyInfo.address || '',
			"商户电话": companyInfo.companyPhone || '',
			"支付优惠总额": null,
			"优惠总额 (包括赠品金额)": _this.formatretain2(gifPaidMoney * 1 + orderJson.totalDiscountAmount * 1 + orderJson.roundingAmount * 1 + addBuyAmout2 * 1),
			"第三方平台券优惠总额": _this.formatretain2(orderJson.tplatAmount * 1 - thirddealPrice * 1),
			"实收金额(含优惠)": orderJson.amountActuallyPaid,
			"实收金额(不包含余额支付的赠送金额)": _this.formatretain2(orderJson.amountActuallyPaid * 1 + thirddealPrice * 1 - giftAmount * 1),
			"找零": (paidMoney).toFixed(2) * 1,
		}]
		console.log(this.dataSet)
		return [this.dataSet, orderJson, canPrint];
	},
	setOnLinefn(_this, data) {
		console.log(data, '订单详情')
		var companyInfo = JSON.parse(localStorage.getItem("companyInfo"));
		//		console.log(data.orderId)
		var {
			docTypeInfo,
			upData,
			deliveryTypeInfo = {},
			items,
			takeCardNoInfo,
			allPayList,
			takeTypeInfo,
			member,
			staff
		} = data;
		//		console.log(data)
		var orderItem = [];
		items.map(it => {
			it.productSet.map(item => {
				orderItem.push({
					...item,
					taste: '',
					realPrice: item.actuallyPaid,
					staffName: it.staff.staffName,
					bmItems: item.bomProductSet || [],
					bomslist: item.bomProductSet || [],
				})
			})
		})
		var payments = [];
		if(allPayList && allPayList[0]) {
			allPayList.map(it => {
				var authCode = '';
				if(it.fastPayInfoJson && it.fastPayInfoJson[0]) {
					var groupCouponName = '';
					it.fastPayInfoJson.map((item, i) => {
						groupCouponName = item.groupCouponName;
						authCode = authCode + (i == 0 ? '' : ',') + item.groupCouponSku;
					})
				}
				payments.push({
					payType: it.payType || "",
					payTypeName: it.payTypeName || "",
					PayTypeName: it.payTypeName || "",
					groupCouponName: groupCouponName || "",
					payAmount: it.payAmount || "",
					remark: it.remark || "",
					authCode: authCode || (it.offlinePayParameter ? (it.offlinePayParameter.unionPayCode || it.offlinePayParameter.groupCouponCode || '') : ''),
				})
			})
		}
		return {
			order: {
				orderNo: data.outOrderNo,
				orderId: data.outOrderNo,
				orderDate: upData.creatDate,
				totalQuantity: upData.totalQuantity,
				payStatusName: data.payStatusName,
				payStatus: data.payStatus || upData.payStatus,
				docTypeName: docTypeInfo.docTypeName,
				docType: docTypeInfo.docType,
				orderDocType: docTypeInfo.orderDocType,
				orderStatusName: data.orderStatusName,
				orderStatus: data.orderStatus || upData.orderStatus,
				totalMoney: data.totalAmount,
				postingDate: data.totalAmount,
				billDay: docTypeInfo.ckey,
				cancelReason: '',
				cancelRemark: '',
				refuseRemark: '',
				mealTakeCode: data.mealTakeCode,
				realMoney: data.amountActuallyPaid * 1,
				totalDiscountAmount: data.totalDiscountAmount * 1,
				productPromotionAmount: data.itemsTotalDiscountAmount || "0" || '商品促销优惠金额',
				promotionAmount: data.orderDiscountAmount || "0" || '订单促销优惠金额',
				discountMoney: data.customDiscountAmount || "0" || '订单自定义折扣金额',
				productCustomDiscountAmount: upData.goodsCustomDiscountAmount || "0" || '商品自定义折扣金额',
				entityCardDiscount: data.orderRealChangeAmount || '0' || '实体卡优惠金额',
				maLing: data.roundingAmount || '0' || '抹零金额',
				storedValueCardDiscountAmount: data.storedValueCardDiscountAmount || '0' || '储值优惠金额',
				orderRealChangeAmount: data.orderRealChangeAmount || '0' || '改价优惠金额',
				payDiscountAmount: 0,
				couponMoney: 0,
				remark: data.remark || '',
				...deliveryTypeInfo,
			},
			configRetailOrder: {},
			guideInfo: {
				staffName: upData.cashier,
				userName: staff.staffName
			},
			Send: {},
			dockInfo: {},
			mealInfo: {
				mealTakeCode: data.mealTakeCode,
				takeCardNo: takeCardNoInfo.takeCardNo,
				companyAddress: companyInfo.address,
				companyName: upData.companyName,
				installType: data.mealTakeCode + '',
				phone: member ? member.phone : '',
				takeTypeAlias: takeTypeInfo.takeType,
				mealAddress: '',
				mealWayName: takeTypeInfo.takeType,
				mealConsignee: member ? member.name : '',
				companyPhone: companyInfo.companyPhone,
			},
			payment: payments,
			orderItem: orderItem,
			member: member,
			upData: upData,
			delivery: {
				deliveryDate: (deliveryTypeInfo.takeTimeQuantums || deliveryTypeInfo.takeDate) ? (deliveryTypeInfo.takeDate + " " + deliveryTypeInfo.takeTimeQuantums) : '',
				...deliveryTypeInfo
			},
		};
	},
	getItems(item, data) {
		return {
			"id": item.id,
			"单据编号": "9W14490980031687228378",
			"商户": "睿本化妆品体验店",
			"单据类型": "零售",
			"单据状态": "已完成",
			"收银状态": "已收银",
			"创建人": "问问",
			"创建时间": "2023-06-20 10:32:58",
			"整单备注": "",
			"总数": 2.0,
			"实收金额": 10.0,
			"商品总额": 6.0,
			"内部核算金额": null,
			"本单积分": null,
			"优惠总额": 0.0,
			"优惠券金额": 0.0,
			"订单优惠总金额": null,
			"配送费": 0.0,
			"溯源码": null,
			"收银员": null,
			"收银员工号": null,
			"打印时间": "2023-06-20 10:45:26",
			"预配送时间": "",
			"订单来源": "无敌零售订单",
			"预计配送时间": "",
			"取餐号": "W1016",
			"商户地址": "广州市番禺区广州番禺汉溪长隆地铁G----更改",
			"商户电话": "161615515151",
			"支付优惠总额": 0.0,
			"第三方平台券优惠总额": 0.0,
			"实收金额(含优惠)": null,
			"找零": null
		}
	},
	getLabelNameFn(item) {
		var labelName = ''
		if(item.labelGroups) {
			item.labelGroups.map((s, i) => {
				s.labelSet.map((set, i) => {
					labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
				})
			})
		}
		return labelName;
	},
	getLabelNameFn2(item) {
		var labelName = ''
		if(item.labelGroups) {
			item.labelGroups.map((s, i) => {
				s.labelSet.map((set, i) => {
					labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
				})
				labelName = labelName + '￥' + s.price
			})
		}
		return labelName;
	},
	labelsFn(item, lables, orderJson) {
		if(item.labelGroups) {
			item.labelGroups.map(s => {
				var labelName = ''
				s.labelSet.map((set, i) => {
					labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
				})
				lables.push({
					"金额": s.price,
					"单价": (s.price / s.quantity).toFixed(2),
					"标签": labelName,
					"备注": null,
					"sku": null,
					"商品编码": item.itemCode,
					"商品名称": item.itemName,
					"规格名称": item.specName,
					"orderItemId": item.id,
					"外卖商品名称": null,
					"外卖商品标签名称": null,
					"外卖商品规格标签名称": null,
					"取餐码": orderJson.mealTakeCode || '',
					"桌号": null,
					"用餐方式": null,
					"清单价": null,
					"时间": null,
					"标签商品数": item.quantity,
					"当前标签商品数": s.quantity,
					"门店名称": null,
					"单据来源": null
				})
			})
		}
	},
	labelData(item, lables, orderJson, _data) {
		console.log(item, 'fsdf')
		if(item.labelGroups) {
			item.labelGroups.map(s => {
				var labelName = ''
				s.labelData.map((set, i) => {
					labelName = labelName + (i == 0 ? '' : ',') + set.labelName + (set.enableChangeFactor ? ("*" + set.factor) : "")
				})
				lables.push({
					"金额": (s.labelPrice * s.quantity).toFixed(2),
					"单价": s.labelPrice.toFixed(2),
					"标签": labelName,
					"备注": null,
					"sku": item.skuBarCode,
					"商品编码": item.itemCode,
					"商品名称": item.itemName,
					"规格名称": item.specName,
					"orderItemId": item.id,
					"外卖商品名称": null,
					"外卖商品标签名称": null,
					"外卖商品规格标签名称": null,
					"取餐码": orderJson.mealTakeCode || '',
					"桌号": orderJson.takeCardNo,
					"用餐方式": null,
					"清单价": item.dealUnitPrice,
					"时间": _data.order && _data.order.orderDate ? (_data.order.orderDate).substring(0, 16) : "",
					"标签商品数": item.quantity,
					"当前标签商品数": 1,
					"门店名称": _data.delivery ? _data.delivery.companyName : "",
					"单据来源": null
				})
			})
		}
		console.log(lables, 'lables')
	}
}
export default processData